<?php

namespace app\common\model;

/**
 * [Pray  祈福忏悔表]
 * @author [C。]
 * @return html
 */
class Pray extends Base
{
    protected $name = 'pray';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getList($map,$from = 0, $size = 5,$field='*')
    {
        $order = ['p.id' => 'desc'];
        $join = [
            ['app_member am','am.id = p.memid'],
        ];
        $result = $this->field($field)
            ->alias('p')
            ->join($join)
            ->where($map)
            ->order($order)
            ->limit($from, $size)
            ->select();

        return $result;
    }
    /**
     * 根据搜索条件获取总条数
     */
    public function getCount($map)
    {
        $join = [
            ['app_member am','am.id = p.memid'],
        ];
        $result = $this
            ->alias('p')
            ->join($join)
            ->where($map)
            ->count();

        return $result;
    }
}